package com.rong.structural.facadeModel;

/**
 * 影院外观类
 */
public class HomeFacade {
    // 定义各个子系统对象
    private DVDPlayer dvdPlayer;
    private Popcorn popcorn;
    private Screen screen;


    public HomeFacade() {
        super();
        // 通过getInstance方法来获取唯一的实例
        this.dvdPlayer = DVDPlayer.getInstance();
        this.popcorn = Popcorn.getInstance();
        this.screen = Screen.getInstance();
    }

    // 操作分为4步
    public void ready() {
        popcorn.on();
        popcorn.pop();
        dvdPlayer.on();
        screen.up();
    }

    public void play(){
        dvdPlayer.play();
    }
    public void pause(){
        dvdPlayer.off();
    }
    public void end(){
        popcorn.off();
        dvdPlayer.off();
        screen.down();
    }
}
